home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 41
/
041.d81
/
pixel puzzler
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
271 lines
10 ifx>.then100
15 poke55,119:poke56,55:clr
20 poke53280,1:poke53281,1
30 printchr$(142)"[147] gathering the pieces to the puzzle..."
100 ifx=0thenx=1:load"text.3.1.o",8,1
120 ifx=1thenx=2:load"space.lnk",8,1
130 ifx=2thenx=3:load"unpacker",8,1
140 ifx=3thenx=4:load"hand.spr",8,1
145 ifx=4thenx=5:load"copymem2.o",8,1
146 ifx=5thenx=6:load"puzzle.fnt",8,1
150 :
160 ni=42 : rem number of items 6*7
170 na=6 : rem number across
180 nd=6 : rem number down-1
182 v=53248:rem vic
183 te=49161:rem hi-res text printer
184 cm=14200:rem copy memory
185 dim a%(ni):mo=1
189 :
190 se$(1)=" [215]inner........[[211]ee [208]icture] "
191 se$(2)=" [201]ntermediate..[[208]lace '[197]m] "
192 se$(3)=" [204]oser.........[[211]lide '[197]m] "
193 se$(4)=" [209]uit..........[[194]ye [194]ye] "
194 sp$=" "
220 poke53281,14:poke53280,14:print"[147]":mo=1:se$=""
235 pokev+21,0:poke53270,peek(53270)and255-16
240 print" [204][207][193][196][211][212][193][210] [208]resents:"
242 print" [208][201][216][197][204] [208][213][218][218][204][197][210]"
244 print" [194]y [193]lan [199]ardner and [205]ike [205]aynard"
246 print" -- [205][193][201][206] [205][197][206][213] --"
247 print" [195][210][211][210] keys scroll -- [210][197][212][213][210][206] selects"
248 printse$;:fora=1to4:printse$(a)" "chr$(13)sp$:next
250 printse$""se$(mo)"[146][187]"
252 print"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]":poke198,.
280 geta$:gosub9000:ifa$=""then280
282 ifa$=chr$(13)then330
284 ifa$=""andmo<4thenmm=1:goto290
286 ifa$="[145]"andmo>1thenmm=-1:goto290
288 goto280
290 printse$""se$(mo)" "chr$(13)sp$
292 ifmm=1thense$=se$+""
294 ifmm=-1thense$=left$(se$,len(se$)-2)
296 mo=mo+mm:goto250
330 ifmo=4then1020
340 ifmo=1thenforx=1toni:a%(x)=x:next:cf=1:gosub7000:gosub6000:gosub7100:goto510
350 gosub 1680
355 sm=1:gosub 4000 : rem show picture
360 :
370 gosub5000
380 :
390 :
400 :
410 cf=0
420 poke1016+52224,24:pokev+39,5:pokev,60:pokev+1,68
430 pokev+29,0:pokev+23,0:pokev+16,0
450 :
460 ifgip=1then510
470 forx=1toni:a%(x)=x:next
480 forx=1toni:r1=rnd(1)*ni+1:r2=rnd(1)*ni+1:t=a%(r1):a%(r1)=a%(r2)
490 a%(r2)=t:next
495 ro=0:co=1
500 :
510 gosub 3300 : rem plot them puppies
600 :
610 fl=0
620 forx=0toni-1
630 ifa%(x+1)<>x+1thenfl=1
640 ifa%(x+1)=nithenbl=x
650 next
660 :
670 ifcf=1then1530
680 iffl=0thensys49161," [217][207][213] [215][207][206]!! ",1,0,0:goto1450
690 j=56320
700 pokev+21,1:gosub 1080:pokev+21,.:ifmathenma=.:goto510
710 a=co+ro*na
720 br=int(bl/na):bc=bl-na*br:bc=bc+1
730 ifmo=2anda%(a)<>nithen1600 : rem plop it
740 if(br<>roandbc<>co)ora%(a)=nithen970
750 ifbr<>rothen870
760 if bc>cothenb=bc:e=co+1:i=-1
770 if bc<cothenb=bc:e=co-1:i=1
780 forx=btoestepi
790 t=ro*na+x:f=ro*na+x+i
800 a%(t)=a%(f)
810 poke254,2+ro*3:poke253,x*5:poke255,a%(t)-1:sys51462
820 poke254,2+ro*3:poke253,(x+i)*5:poke255,ni-1:sys51462
830 next
840 ag=3.34:a%(ro*na+x)=ni
850 goto 610
860 :
870 ifbc<>cothen960
880 ifbr>rothenb=br:e=ro+1:i=-1
890 ifbr<rothenb=br:e=ro-1:i=1
900 forx=btoestepi
910 t=x*na+co:f=(x+i)*na+co:a%(t)=a%(f)
920 poke253,co*5:poke254,2+x*3:poke255,a%(t)-1:sys51462
930 poke253,co*5:poke254,2+(x+i)*3:poke255,ni-1:sys51462
940 ag=3.34:next
950 a%(x*na+co)=ni:goto610
960 :
970 sys49161," [201][204][204][197][199][193][204] [205][207][214][197] ",1,0,0:sys49167,1000,33,15,15
980 fordl=1to500:next:sys49167,0,32,0,0
990 sys49161," ",13,0,0
1000 goto 700
1010 :
1020 pokev+21,0:pokev+16,0:print"[147]"
1030 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
1040 ifer<>63thenpoke198,.:end
1050 load"hello connect",8
1060 end
1070 :
1080 rem read keyboard and joystick
1090 ifpeek(198)=0andpeek(j)=127thenpokev+39,(peek(v+39)and15)+1:goto1090
1100 geta$:js=peek(j):ifjs=111ora$=chr$(13)thenreturn
1110 cf=0:ifa$="w"thenforx=1toni:a%(x)=x:next:cf=1:ma=1:return
1115 ifa$="h"thenpokev+21,.:gosub3000:pokev+21,1:gosub5000:goto1090
1120 ifa$="m"thengosub1320:goto1090
1130 ifa$="s"thengosub1980:goto1090
1135 ifa$="v"thenpokev+21,.:gosub4000:gosub5000:pokev+21,1:goto1090
1137 pokev+39,(peek(v+39)and15)+1
1140 ifa$=""orjs=119thenco=co+1
1150 ifa$="[157]"orjs=123thenco=co-1
1160 ifa$=""orjs=125thenro=ro+1
1170 ifa$="[145]"orjs=126thenro=ro-1
1180 ifjs=118thenco=co+1:ro=ro-1
1190 ifjs=117thenco=co+1:ro=ro+1
1200 ifjs=121thenco=co-1:ro=ro+1
1210 ifjs=122thenco=co-1:ro=ro-1
1220 :
1230 ifco<1thenco=1
1240 ifro<0thenro=0
1250 ifro>ndthenro=nd
1260 ifco>nathenco=na
1270 :
1280 pokev,21+co*39:pokev+1,68+ro*24:pokev+16,0
1290 goto1090
1300 :
1310 :
1320 rem quit
1330 sys49161," [196][207] [217][207][213] [215][193][206][212] [212][207] [209][213][201][212] [212][200][201][211] [208][213][218][218][204][197]? ",1,0,0
1340 forx=1to100:ifpeek(198)=0thennextx
1350 ifpeek(198)<>0then1410
1360 sys49161," ",4,0,0
1370 fory=1to100:ifpeek(198)=0thennexty
1380 ifpeek(198)<>0then1410
1390 goto1330
1400 :
1410 geta$
1420 ifa$<>"y"thensys49161," ",4,0,0:return
1430 :
1440 sys51459:goto220
1445 :
1450 pokev+21,.
1460 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
1470 forx=1000to20000step500:sys49167,x,33,15,15:next
1480 forx=1000to20000step500:sys49167,x,33,15,15:next
1490 forx=1000to20000step500:sys49167,x,33,15,15:next
1500 sys49167,0,32,0,0
1510 fordl=1to100:nextdl
1520 :
1530 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
1540 syste,"[208][210][197][211][211] [193][206][217] [203][197][217]",14,24,.:poke198,.
1550 a=peek(203):ifa=64then1550
1560 sys51459:goto220
1590 :
1600 rem plop it
1610 ifa%(a)=nithen870
1620 t=a%(a):a%(a)=a%(bl+1):a%(bl+1)=t
1630 poke254,2+ro*3:poke253,co*5
1640 poke255,ni-1:sys51462:ag=3.34
1650 poke254,2+br*3:poke253,bc*5
1660 poke255,t-1:sys51462:ag=3.34
1670 goto610
1680 rem game in progress
1690 gip=0:pokev+21,0
1700 print"[147] [215][207][213][204][196] [217][207][213] [204][201][203][197] [212][207] [204][207][193][196] [193]"
1710 print" [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]?"
1720 poke198,0:wait198,1:geta$:ifa$<>"y"then1790
1730 :
1740 f$="pp.gip"
1750 gip=1
1760 open2,8,2,f$
1770 forx=1toni:input#2,a%(x):next
1780 close2
1790 gosub7000:gosub7100:gosub6000
1795 syste,"[208]lease wait -- [208]lotting [208]icture.",4,11,.
1800 pokev+21,.:return
1970 :
1980 rem save gip
1990 rem
2000 sys49161," [211][193][214][201][206][199] [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]... ",1,1,0
2010 open15,8,15,"i0":print#15,"s0:pp.gip":close15
2020 :
2030 f$="0:pp.gip,s,w"
2040 open2,8,2,f$
2050 forx=1toni
2060 print#2,a%(x)
2070 next
2080 close2
2090 sys49161," ",1,1,0
2092 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210]",13,1,1
2100 return
3000 poke53280,14:poke53281,14
3010 syscm,55296,25576,1000:sys51459
3020 print"[147] [208][201][216][197][204] [208][213][218][218][204][197][210]"
3030 print" [212][207] [205][207][214][197] [212][200][197] [200][193][206][196], [213][211][197] [212][200][197] [195][213][210][211][207][210]"
3040 print" [203][197][217][211] [207][210] [212][200][197] [202][207][217][211][212][201][195][203] ([201][206] [208][207][210][212] 2)."
3050 print" [215][200][197][206] [212][200][197] [200][193][206][196] [201][211] [207][206] [212][200][197] [208][201][197][195][197]"
3060 print" [217][207][213] [215][201][211][200] [212][207] [205][207][214][197], [208][210][197][211][211] [210][197][212][213][210][206] [207][210]"
3062 print" [212][200][197] [198][201][210][197][194][213][212][212][207][206]."
3080 print" [212][207] [211][193][214][197] [193] [199][193][205][197], [208][210][197][211][211] '[211]'"
3090 print" [212][207] [199][197][212] [212][207] [212][200][197] [205][197][206][213], [208][210][197][211][211] '[205]'"
3092 print" [212][20